﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using PQ.Util;

namespace PQ
{
    public partial class Options : Form
    {
        USB1612M target = new USB1612M(); // TODO: 初始化为适当的值
        public Options()
        {
            InitializeComponent();
        }

        private void btnStartUp_Click(object sender, EventArgs e)
        {
            
            bool expected = false; // TODO: 初始化为适当的值
            bool actual;
            target.OpenDevice();
            target.StartSample(USB1612M.CH12, USB1612M.Fre200KHz, USB1612M.SoftwareTrigger);
            double[][] data;
            int sec = -1;
            int count = 0;

            int timeIntvl = 0;
            while (true)
            {

              //  data = target.Read();
               // this.textBox1.AppendText(data.Length+"");
                this.textBox1.AppendText(DateTime.Now + "." + DateTime.Now.Millisecond + "   " + timeIntvl + "\n");
               // timeIntvl += target.pointNum;
                if (count++ % 500 == 0)
                {
                    DateTime d = target.startDateTime.AddMilliseconds(timeIntvl / 200.000);
                 //   this.textBox1.AppendText(DateTime.Now + "." + DateTime.Now.Millisecond + "   " + timeIntvl + "\n");
                 //   this.textBox1.AppendText(d + "." + d.Millisecond + "\n");
                }
            }
        }
    }
}
